import 'package:dio/dio.dart';

class Network{
  static String apiUrl = 'https://api.csggldc.com/';

  Future<dynamic> post(String api,{dynamic data}) async {
    try {
      print('url =======' + '$apiUrl$api');
      print('data =======' + '$data');
      var result = await Dio().post(apiUrl+api,
          data: data,
      );
      return result.data;
    } catch (e) {
      return {'code': 500};
    }
  }

  Future<dynamic> get(String api,{dynamic params}) async {
    try {
      print('url =======' + '$apiUrl$api');
      var result = await Dio().get('$apiUrl$api');
      return result.data;
    } catch (e) {
      return {'code': 500};
    }
  }

}